<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0
        }
    </style>
</head>
<body>
<div>
    <% JSON.parse(chartConfigStr).forEach(function(item, index) { %>
        <div id="container-<%= index %>"
             style="display: inline-block;height: <%= chartHeight %>px; width: <%= chartWidth %>px;"></div>
    <% }); %>
</div>
<script src="/charts/echarts5.min.js"></script>
<script type="text/javascript">
  function initCharts(config, index) {
    const chartConfig = config;
    chartConfig.animation = false;
    const myChart = echarts.init(document.getElementById(`container-${index}`));
    myChart.setOption(chartConfig);
  }
  <% JSON.parse(chartConfigStr).forEach(function(item, index) { %>
  ;initCharts(<%- JSON.stringify(item) %>, <%- index %>);
  <% }); %>
</script>

</body>
</html>
